<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<jsp:include page="/WEB-INF/jsp/inc/include-easyUI.jsp"></jsp:include>
	<!-- 弹出框 -->
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/plugins/sweetalert/dist/sweetalert.css">
	<script src="${pageContext.request.contextPath}/static/plugins/sweetalert/dist/sweetalert.min.js"></script>
	
	<script src="${pageContext.request.contextPath}/static/plugins/js/outlook2.js" type="text/javascript"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/plugins/js/validDate.js"></script>
	
	<!-- 时间选择器 -->
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/static/plugins/jeDate/jedate/skin/jedate.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/plugins/jeDate/jedate/jedate.js"></script>
    
<style type="text/css">
.btn {
	height: inherit;
	border: 0;
}


</style>
</head>
<body>

	<div class="main-content">
		<div class="breadcrumbs" id="breadcrumbs">
			<script type="text/javascript">
 				try { 
 					ace.settings.check('breadcrumbs', 'fixed') 
 				} catch (e) { 
 				} 
			</script> 
			<ul class="breadcrumb">
				<li class="active">账务关系管理</li>
			</ul>
		</div>
		<div class="page-content">
			<div class="page-header" style="margin: 0px;float: left;width: 100%;margin-bottom: 10px;">
				<h1>转账关系表</h1>
			</div>
			<!-- /.page-header -->
			
			<div>
				<div class="col-xs-12 col-sm-12">
					<!-- 搜索form -->
					<form id="searchUserForm" action="" class="form-horizontal" role="form" >
						<div class="space-4"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="search-countDatetime"> 时间 </label>
							<div class="col-sm-9">
								<input type="text" id="search-countDatetime" name="countDatetime" 
									placeholder="时间" class="col-xs-10 col-sm-5" readonly="true"/>
								<div id="getBeginTime"></div>
								
								<div>
			                        <button type="button" id="btn-search" class="btn btn-primary start" style="margin-left: 100px;">
					                    <i></i>
					                    <span>搜索</span>
					                </button>
					                <button type="reset" class="btn btn-warning cancel" style="margin-left: 20px;">
					                    <i></i>
					                    <span>取消</span>
					                </button>
	                           </div>
							</div>
							
						</div>
						<div class="space-4"></div>
					</form>
					
				</div><!-- /.col -->
			</div><!-- /.row -->
			
			<div id="content" region="center" title="消费统计" style="overflow: hidden">
			</div>
			<table id="consumeCountList" border="false" width="100%" height="450px">
			</table>
			
			<!-- /.page-header -->
			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<!-- PAGE CONTENT ENDS -->
				</div><!-- /.col -->
			</div><!-- /.row -->
		</div><!-- /.page-content -->
	</div><!-- /.main-content -->
<script type="text/javascript">
	jeDate({
		dateCell:"#search-countDatetime",//直接显示日期层的容器，可以是ID  CLASS
		format:"YYYY-MM",//日期格式
		isinitVal:false, //是否初始化时间
		festival:false, //是否显示节日
		isTime:true, //是否开启时间选择
		minDate:"2017-06-01 00:00:00",//最小日期
		maxDate:jeDate.now(0), //设定最大日期为当前日期
	});
	
	   var consumeCountGrid;
       $(function () {
        //定义获取数据网格的动态列属性
   		var dataQualityGrid_columns = null;
   		var dataQualityGrid_columns_url = "${pageContext.request.contextPath}/admin/accountingRelations/getDataGridColumns.do";
   		$.ajax({
   			type : "get",
   			url : dataQualityGrid_columns_url,
   			cache : true,
   			async : false,
   			dataType : "json",
   			success : function(data) {
   				if(data != null && data.length > 0 && data[0] != null){
   					data.forEach(function (node) {
   						node.width=200;
   					});
   					dataQualityGrid_columns = [ data ];
   				}
   			}
   		});
   		if(dataQualityGrid_columns != null){
   			consumeCountGrid = $("#consumeCountList").datagrid({
   		 		url: '${pageContext.request.contextPath}/admin/accountingRelations/getList.do',
                rownumbers: true,
                fitColumns:true,
                singleSelect:true,
                idField: 'id',
                loadMsg : "正在加载数据，请等待！",
                onLoadError:function(data){
                },
   				columns :  dataQualityGrid_columns ,
            });
   		}
      });
      
     function reloadDataGrid() {
         consumeCountGrid.datagrid('clearChecked');
         consumeCountGrid.datagrid('reload');
     }

	//快速搜索按钮
	$('#btn-search').click(function(){
	   consumeCountGrid.datagrid('unselectAll');
          	var countDatetime = $('#search-countDatetime').val();
		consumeCountGrid.datagrid('load', {
			countDatetime : countDatetime,
		});
	});
	</script>	
  </body>
</html>
